Queue a redraw on the tab area when a tab changes size. (Includes
authorOwen Taylor <otaylor@redhat.com>
Tue, 26 Jan 1999 00:37:58 +0000 (00:37 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Tue, 26 Jan 1999 00:37:58 +0000 (00:37 +0000)
Mon Jan 25 19:41:56 1999  Owen Taylor  <otaylor@redhat.com>

* gtk/gtknotebook.c (gtk_notebook_page_allocate): Queue
a redraw on the tab area when a tab changes size.
(Includes improvements from Lars Hamann)

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtknotebook.c

index af4978a4ba80bd6334052a811b645a21516f341e..847b45f155e3730aaf05d8470a30be7e7aa5f532 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Mon Jan 25 19:41:56 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtknotebook.c (gtk_notebook_page_allocate): Queue
+       a redraw on the tab area when a tab changes size.
+       (Includes improvements from Lars Hamann)
+
 Mon Jan 25 19:00:13 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkcolorsel.c (gtk_color_selection_value_events): 
@@ -5,7 +11,9 @@ Mon Jan 25 19:00:13 1999  Owen Taylor  <otaylor@redhat.com>
         try a different one that is less dependent on
         the state of the widget. Just redraw the value_marker
         when it gets mapped. Somebody needs to analyze
-        this widget more carefully and figure out 
+        this widget more carefully and figure out when
+        it should be setting the contents of the previews
+        with more care.
 
 Mon Jan 25 17:48:03 1999  Owen Taylor  <otaylor@redhat.com>
 
index af4978a4ba80bd6334052a811b645a21516f341e..847b45f155e3730aaf05d8470a30be7e7aa5f532 100644 (file)
@@ -1,3 +1,9 @@
+Mon Jan 25 19:41:56 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtknotebook.c (gtk_notebook_page_allocate): Queue
+       a redraw on the tab area when a tab changes size.
+       (Includes improvements from Lars Hamann)
+
 Mon Jan 25 19:00:13 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkcolorsel.c (gtk_color_selection_value_events): 
@@ -5,7 +11,9 @@ Mon Jan 25 19:00:13 1999  Owen Taylor  <otaylor@redhat.com>
         try a different one that is less dependent on
         the state of the widget. Just redraw the value_marker
         when it gets mapped. Somebody needs to analyze
-        this widget more carefully and figure out 
+        this widget more carefully and figure out when
+        it should be setting the contents of the previews
+        with more care.
 
 Mon Jan 25 17:48:03 1999  Owen Taylor  <otaylor@redhat.com>
 
index af4978a4ba80bd6334052a811b645a21516f341e..847b45f155e3730aaf05d8470a30be7e7aa5f532 100644 (file)
@@ -1,3 +1,9 @@
+Mon Jan 25 19:41:56 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtknotebook.c (gtk_notebook_page_allocate): Queue
+       a redraw on the tab area when a tab changes size.
+       (Includes improvements from Lars Hamann)
+
 Mon Jan 25 19:00:13 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkcolorsel.c (gtk_color_selection_value_events): 
@@ -5,7 +11,9 @@ Mon Jan 25 19:00:13 1999  Owen Taylor  <otaylor@redhat.com>
         try a different one that is less dependent on
         the state of the widget. Just redraw the value_marker
         when it gets mapped. Somebody needs to analyze
-        this widget more carefully and figure out 
+        this widget more carefully and figure out when
+        it should be setting the contents of the previews
+        with more care.
 
 Mon Jan 25 17:48:03 1999  Owen Taylor  <otaylor@redhat.com>
 
index af4978a4ba80bd6334052a811b645a21516f341e..847b45f155e3730aaf05d8470a30be7e7aa5f532 100644 (file)
@@ -1,3 +1,9 @@
+Mon Jan 25 19:41:56 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtknotebook.c (gtk_notebook_page_allocate): Queue
+       a redraw on the tab area when a tab changes size.
+       (Includes improvements from Lars Hamann)
+
 Mon Jan 25 19:00:13 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkcolorsel.c (gtk_color_selection_value_events): 
@@ -5,7 +11,9 @@ Mon Jan 25 19:00:13 1999  Owen Taylor  <otaylor@redhat.com>
         try a different one that is less dependent on
         the state of the widget. Just redraw the value_marker
         when it gets mapped. Somebody needs to analyze
-        this widget more carefully and figure out 
+        this widget more carefully and figure out when
+        it should be setting the contents of the previews
+        with more care.
 
 Mon Jan 25 17:48:03 1999  Owen Taylor  <otaylor@redhat.com>
 
index af4978a4ba80bd6334052a811b645a21516f341e..847b45f155e3730aaf05d8470a30be7e7aa5f532 100644 (file)
@@ -1,3 +1,9 @@
+Mon Jan 25 19:41:56 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtknotebook.c (gtk_notebook_page_allocate): Queue
+       a redraw on the tab area when a tab changes size.
+       (Includes improvements from Lars Hamann)
+
 Mon Jan 25 19:00:13 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkcolorsel.c (gtk_color_selection_value_events): 
@@ -5,7 +11,9 @@ Mon Jan 25 19:00:13 1999  Owen Taylor  <otaylor@redhat.com>
         try a different one that is less dependent on
         the state of the widget. Just redraw the value_marker
         when it gets mapped. Somebody needs to analyze
-        this widget more carefully and figure out 
+        this widget more carefully and figure out when
+        it should be setting the contents of the previews
+        with more care.
 
 Mon Jan 25 17:48:03 1999  Owen Taylor  <otaylor@redhat.com>
 
index af4978a4ba80bd6334052a811b645a21516f341e..847b45f155e3730aaf05d8470a30be7e7aa5f532 100644 (file)
@@ -1,3 +1,9 @@
+Mon Jan 25 19:41:56 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtknotebook.c (gtk_notebook_page_allocate): Queue
+       a redraw on the tab area when a tab changes size.
+       (Includes improvements from Lars Hamann)
+
 Mon Jan 25 19:00:13 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkcolorsel.c (gtk_color_selection_value_events): 
@@ -5,7 +11,9 @@ Mon Jan 25 19:00:13 1999  Owen Taylor  <otaylor@redhat.com>
         try a different one that is less dependent on
         the state of the widget. Just redraw the value_marker
         when it gets mapped. Somebody needs to analyze
-        this widget more carefully and figure out 
+        this widget more carefully and figure out when
+        it should be setting the contents of the previews
+        with more care.
 
 Mon Jan 25 17:48:03 1999  Owen Taylor  <otaylor@redhat.com>
 
index af4978a4ba80bd6334052a811b645a21516f341e..847b45f155e3730aaf05d8470a30be7e7aa5f532 100644 (file)
@@ -1,3 +1,9 @@
+Mon Jan 25 19:41:56 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtknotebook.c (gtk_notebook_page_allocate): Queue
+       a redraw on the tab area when a tab changes size.
+       (Includes improvements from Lars Hamann)
+
 Mon Jan 25 19:00:13 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkcolorsel.c (gtk_color_selection_value_events): 
@@ -5,7 +11,9 @@ Mon Jan 25 19:00:13 1999  Owen Taylor  <otaylor@redhat.com>
         try a different one that is less dependent on
         the state of the widget. Just redraw the value_marker
         when it gets mapped. Somebody needs to analyze
-        this widget more carefully and figure out 
+        this widget more carefully and figure out when
+        it should be setting the contents of the previews
+        with more care.
 
 Mon Jan 25 17:48:03 1999  Owen Taylor  <otaylor@redhat.com>
 
index 2aa82649909767879c3c97bf12ab1d2d48891f7e..88dd82905424e673119c53cb2d353e92c8c6a569 100644 (file)
@@ -2988,6 +2988,7 @@ gtk_notebook_page_allocate (GtkNotebook     *notebook,
                            GtkNotebookPage *page,
                            GtkAllocation   *allocation)
 {
+  GtkWidget *widget;
   GtkAllocation child_allocation;
   gint xthickness;
   gint ythickness;
@@ -2997,10 +2998,59 @@ gtk_notebook_page_allocate (GtkNotebook     *notebook,
   g_return_if_fail (page != NULL);
   g_return_if_fail (allocation != NULL);
 
-  page->allocation = *allocation;
+  widget = GTK_WIDGET (notebook);
+
+  xthickness = widget->style->klass->xthickness;
+  ythickness = widget->style->klass->ythickness;
+
+  /* If the size of the notebook tabs change, we need to queue
+   * a redraw on the tab area
+   */
+  if ((allocation->width != page->allocation.width) ||
+      (allocation->height != page->allocation.height))
+    {
+      gint x, y, width, height, border_width;
+
+      border_width = GTK_CONTAINER (notebook)->border_width;
+
+      switch (notebook->tab_pos)
+       {
+       case GTK_POS_TOP:
+         width = widget->allocation.width;
+         height = MAX (page->allocation.height, allocation->height) +
+           ythickness;
+         x = 0;                              
+         y = border_width;
+         break;
+
+       case GTK_POS_BOTTOM:
+         width = widget->allocation.width + xthickness;
+         height = MAX (page->allocation.height, allocation->height) +
+           ythickness;
+         x = 0;                              
+         y = widget->allocation.height - height - border_width;
+         break;
+
+       case GTK_POS_LEFT:
+         width = MAX (page->allocation.width, allocation->width) + xthickness;
+         height = widget->allocation.height;
+         x = border_width;
+         y = 0;
+         break;
+
+       case GTK_POS_RIGHT:
+       default:                /* quiet gcc */
+         width = MAX (page->allocation.width, allocation->width) + xthickness;
+         height = widget->allocation.height;
+         x = widget->allocation.width - width - border_width;
+         y = 0;
+         break;
+       }
+
+      gtk_widget_queue_clear_area (widget, x, y, width, height);
+    }
 
-  xthickness = GTK_WIDGET (notebook)->style->klass->xthickness;
-  ythickness = GTK_WIDGET (notebook)->style->klass->ythickness;
+  page->allocation = *allocation;
 
   if (notebook->cur_page != page)
     {